﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

/*👇结构体关键词*/
struct student {
	/*👆结构体标签名*/
 /*👇结构体成员列表*/
	char name[20];
	int age;
	float score;
}s4/*={初始化内容}*/, s5, s6;/*全局结构体变量*/

struct student s3 = { "王五",25,88.8 };   /*全局结构体变量*/

struct Point {
	int x;
	int y;
};/*结构体后要写分号*/

struct S {
	char ch;
	struct Point p;
	int arr[10];
	double d;
};
int main() {
	struct student s1 = { "翠花",20,98.0 };   /*结构体变量：结构体是图纸，结构体变量才能存储信息*/
	struct student s2 = { "旺财",18,69.8 };	  /*s1,s2为局部结构体变量*/
	struct Point p = { 10,20 };
	struct S s = { 0,{1,2},{1,2,3,4,5,6,7,8,9,10},3.14 };
	/*结构体变量的初始化*/
	/*结构体变量的访问：结构体变量.结构体成员*/
	printf("%s %d %f\n", s1.name, s1.age, s1.score);
	printf("坐标是:(%d,%d)\n", s.p.x, s.p.y);
	printf("%lf", s.d);
	/*结构体变量.结构体成员名*/
	/*->操作符依赖于指针*/
	return 0;
}
